package com.platform.core.entity;

import com.platform.comm.entity.IdEntity;
import com.platform.comm.enums.YnEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.time.LocalDateTime;

/**
 * Description: 日志实体类
 *
 * @author libin Created on 2019/7/18
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "ncloud_sys_log")
public class SysLog extends IdEntity {

    private static final long serialVersionUID = -3275422298658090442L;
    /**
     * 操作名称
     */
    @Column(name = "operate_name", length = 128, nullable = false)
    private String operateName;

    /**
     * 模块名称
     */
    @Column(name = "module_name", length = 128, nullable = false)
    private String moduleName;

    /**
     * 操作类型
     */
    @Column(name = "operate_type", length = 128)
    private String operateType;

    /**
     * 请求路径
     */
    @Column(name = "request_url", length = 256)
    private String requestUrl;

    /**
     * 操作人员
     */
    @Column(name = "user_id", length = 36, nullable = false)
    private String userId;

    /**
     * 登录名称
     */
    @Column(name = "login_name", length = 128)
    private String loginName;


    /**
     * 操作时间
     */
    @Column(name = "operate_date", nullable = false)
    private LocalDateTime operateDate;

    /**
     * 远程地址
     */
    @Column(name = "remote_address", length = 50)
    private String remoteAddress;

    /**
     * 操作结果
     */
    @Column(name = "action_result", length = 128)
    private String actionResult;

    /**
     * 是否成功
     */
    @Column(name = "is_success", length = 2)
    private YnEnum success;

    /**
     * 操作类型
     */
    @Column(name = "type", length = 128)
    private String type;
}
